<?php

namespace App\Listener;

use App\Event\PubMomentEvent;
use App\Model\Message;
use Hyperf\Event\Annotation\Listener;
use Hyperf\Event\Contract\ListenerInterface;

/**
 * 通知消息监听器
 * @Listener 
 */
class MessageNoticeListener implements ListenerInterface
{
    public function listen(): array
    {
        return [
            //发布动态
            PubMomentEvent::class,
        ];
    }

    /**
     * @param UserRegistered $event
     */
    public function process(object $event)
    {
        switch ($event->eventType) {
                //发布动态
            case 'moment':
                Message::pushOfficialMsg($event->userId, '刚刚发布的动态正在审核中, 审核结果稍后会告知你, 谢谢~');
                break;
        }
        return;
    }
}
